package com.eastcom.bm.service.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.eastcom.bm.atom.Atom_ActionEmailNotice;
import com.eastcom.bm.dao.DAOFactory;
import com.eastcom.bm.dao.IEmailNoticeDao;
import com.eastcom.bm.service.IEmailNoticeService;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.providor.BMSetting;

public class EmailNoticeService implements IEmailNoticeService {

	private static Logger log = BMSetting.getBMlog();
	
	public List<Atom_ActionEmailNotice> getAllEmailNotice() {
		try{
			IEmailNoticeDao emailNoticeDao=DAOFactory.getInstance().getEmailNoticeDao();
			return emailNoticeDao.getAllEmailNotice();
		}
		catch(Exception e){
			log.error("IEmailNoticeService getAllEmailNotice error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

	public Atom_ActionEmailNotice findEmailNoticeByUUID(String uuid) {
		try{
			IEmailNoticeDao emailNoticeDao=DAOFactory.getInstance().getEmailNoticeDao();
			return emailNoticeDao.findEmailNoticeByUUID(uuid);
		}
		catch(Exception e){
			log.error("IEmailNoticeService findEmailNoticeByUUID error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

}
